package com.ccdc.lbcmsystem.mapper;

import com.ccdc.lbcmsystem.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@Mapper
@Component
public interface UserMapper {
    //查询所有管理员用户
    List<User> queryUserList();
    //查询所有工作人员用户
    List<User> queryCommunityList();
    //通过用户名来进行查询
    User queryUserByUserName(@RequestParam("userName") String userName);
    //新增用户
    int addUser(@RequestParam("user") User user);
    //根据ID查询用户信息
    User queryUserById(@RequestParam("id") Integer id);
    //根据ID修改信息
    int updateUserById(@RequestParam("id") Integer id,@RequestParam("name") String name,@RequestParam("passWord") String passWord,@RequestParam("email") String email,
                   @RequestParam("tel") String tel,@RequestParam("role") String role);
    //根据ID删除用户
    int delUserById(@RequestParam("id") Integer id);
    //启用用户账号
    int enableUserById(@RequestParam("id") Integer id);
    //禁用用户账号
    int disableUserById(@RequestParam("id") Integer id);
    //初始化密码
    int initializePwdById(@RequestParam("id") Integer id);
    //通过用户名来查询管理员
    List<User> queryListUserByUserName(@RequestParam("userName") String userName);
    //通过用户名来查询社区工作人员
    List<User> queryListCommunityListByUserName(@RequestParam("userName") String userName);
    //根据ID修改用户密码
    int updateUserPwdById(@RequestParam("id") Integer id,@RequestParam("passWord") String passWord);
    //查询审核中状态的账号（注册审核数量）
    List<User> queryListUserByExamineStatus(@RequestParam("examineStatus") String examineStatus);
    //个人中心修改信息
    int editUser(@RequestParam("id") Integer id,@RequestParam("name") String name,@RequestParam("tel") String tel
            ,@RequestParam("email") String email);
    //账号注销
    int cancellationUser(@RequestParam("id") Integer id,@RequestParam("cancellationStatus") String cancellationStatus);
}
